using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using System.IO;

namespace Lizk.DShowPlayer
{

    [XmlRoot("TVTuner")]
    public class TvSettings
    {
        private List<ChannelInfo> channels = new List<ChannelInfo>();

        public List<ChannelInfo> Channels
        {
            get { return channels; }
            set { channels = value; }
        }

        private InputDevice device;

        public InputDevice Device
        {
            get { return device; }
            set { device = value; }
        }


        private Lizk.DShowPlayer.TVPlayer.InputType tunerInput;

        public Lizk.DShowPlayer.TVPlayer.InputType TunerInput
        {
            get { return tunerInput; }
            set { tunerInput = value; }
        }
        public TvSettings() { }

        private bool available;
        [XmlIgnore]
        public bool Available
        {
            get { return available; }
            set { available = value; }
        }

        public override string ToString()
        {
            return device.Name + (available ? "" : " (Unavailable)");
        }


    }


    [XmlRoot]
    public class InputDevice
    {
        private string name;

        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        private string path;

        public string DevicePath
        {
            get { return path; }
            set { path = value; }
        }
        public InputDevice(string name, string path)
        {
            this.name = name;
            this.path = path;
        }
        public InputDevice() { }
        public override string ToString()
        {
            return name;
        }
    }
    

    [XmlRoot("Channel")]
    public class ChannelInfo
    {
        private int channel;

        public int Channel
        {
            get { return channel; }
            set { channel = value; }
        }
        private string channelName;

        public string Name
        {
            get { return channelName; }
            set { channelName = value; }
        }
        public ChannelInfo()
        {
        }
        public ChannelInfo(int channel, string name)
        {
            this.channel = channel;
            this.channelName = name;
        }
        public override string ToString()
        {
            return "Ch " + channel + ": " + channelName;
        }
    }
}
